<?php
namespace app\admin\controller\sys;

use app\BaseController;
use app\common\business\sys\CommonSysCityConfig as serviceModel;

class CommonSysCityConfig extends BaseController
{

    /*
     * 加载省市数据
     */
    public function listAll(){
        $where = [];
        $where[] = ['parent_id','=',0];
        $data = [
            'lists' => serviceModel::getListAll($where)
        ];
        jsonSuccess($data);
    }

    public function list(){
        $fildes = 'page';
        $receiveData = getData($this->request->post(),$fildes);
        $limit_start = ($receiveData['page']-1) * env('page_size');
        $data = [
            'lists' => serviceModel::getList([],$limit_start,env('page_size')),
            'allpage' => serviceModel::getCount([])
        ];
        jsonSuccess($data);
    }

}
